package com.atguigu.guli.service.statistics.service.statistics.task;

import com.atguigu.guli.service.statistics.service.DailyService;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;

public class taskGenarateStatisticsData {

    @Autowired
    DailyService dailyService ;
    @Scheduled(cron = "0 0 2 * * ?")
    public void genarateStatisticsData() {
        //获取前一天日期
        String day = new DateTime().minusDays(1).toString("yyyy-MM-dd");
        dailyService.genStatistics(day);
    }
}
